var isPalindrome = function(str) {
    /* let last=0
    let num=x
    while(x!=0){
      last =x%10+last*10
      x=Math.floor(x/10)
    }
    return last===num;  */ 
   /*  let str =x.toString();
    let arr =str.split('')
    let newArr = arr.reverse();
    let newStr =newArr.join('');
    return newStr===str;
 */
   //let str='yesay'
   let i=0
   let j=str.length-1
   while(i<j){
    if(str[i]!=str[j]){
        return false; 
    }
    i++;
    j--;
   }
   return true;
};
console.log(isPalindrome('yesay'));
